[{if $smarty.session.access > 0}]
<table id="materialTable" class="sortable">
  <thead>
    <tr><th>Type Name</th>
      <th>Needed</th>
      <th>In Stock</th>
      <th>To Buy</th></tr>
  </thead>
  <tbody>
    [{foreach from=$materials item=mat key=id name=matlist}]
    <tr>
      <td>[{$mat.typeName}]</td>
      <td>[{$mat.needed|number_format:0}]</td>
      <td>[{$mat.stock|number_format:0}]</td>
      <td>[{$mat.toBuy|number_format:0}]</td>
    </tr>
    [{/foreach}]
  </tbody>
</table>
[{literal}]<script language="javascript" type="text/javascript">
  var jobTableFilters = {
    col_0: "select",
    sort_select: true,
    btn: false,
    loader: true,
    loader_text: "Filtering data...",
    loader_html: '<img src="./images/loader.gif" alt="" ' +
      'style="vertical-align:middle;" /><h3>Loading...</h3>',
    display_all_text: "< Show all >"
  }
  setFilterGrid("materialTable",jobTableFilters);
</script>[{/literal}]
[{/if}]